<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>修改</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
    {include file='public/head.html'}
</head>
<body class="childrenBody {:dialog_css()}">

<form class="layui-form" action="{:url('edit')}" method="post">
    <input type="hidden" name="id" value="{$vo.id}"/>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">账户</label>
        <div class="layui-input-block">
            <input type="text" name="username" readonly value="{$vo.username}" class="layui-input layui-bg-gray"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">角色组</label>
        <div class="layui-input-block">
            {:form_select('group_id', widget('admin_group')->get(), $vo['group_id'])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">昵称</label>
        <div class="layui-input-block">
            <input type="text" name="nickname" lay-verify="required" lay-reqtext="请输入昵称" placeholder="请输入昵称" value="{$vo.nickname}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">修改密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" placeholder="不修改请留空" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
            <input type="password" name="re_password" placeholder="不修改请留空" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">简介</label>
        <div class="layui-input-block">
            <input type="text" name="about" placeholder="请输入简介" value="{$vo.about}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">QQ号</label>
        <div class="layui-input-block">
            <input type="text" name="qq" placeholder="请输入QQ号" value="{$vo.qq}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机</label>
        <div class="layui-input-block">
            <input type="text" name="mobile" lay-verify="phone" placeholder="请输入手机号" value="{$vo.mobile}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" value="{$vo.email}" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                修改
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['aphpForm', 'aphp', 'form'], function () {
        var aphpForm = layui.aphpForm;
        var form = layui.form;
        var aphp = layui.aphp;

        //aphpForm.bindEvent('.layui-form');

        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 0, function () {
                parent.layer.close(parent.layer.getFrameIndex(window.name));
                parent.layui.table.reload('currentTable');
            });
            return false;
        });
    })
</script>
</body>
</html>